﻿using NodeCanvas.Framework;
using UnityEngine;

namespace Snake.Gameplay
{
    public partial class GameplayAbilityComponent : MonoBehaviour
    {
        public virtual Blackboard Blackboard { get; protected set; }
        public virtual GameplayAttributeSet AttributeSet { get; protected set; }
        public virtual GameplayTagContainer TagContainer { get; protected set; }
        public virtual GameplayCueContainer CueContainer { get; protected set; }
        public virtual GameplayEffectsContainer EffectsContainer { get; protected set; }
        public virtual GameplayAbilitiesContainer AbilitiesContainer { get; protected set; }

        protected virtual void Awake()
        {
            Blackboard = GetComponent<Blackboard>();
            AttributeSet = new GameplayAttributeSet(this);
            TagContainer = new GameplayTagContainer(this);
            CueContainer = new GameplayCueContainer(this);
            EffectsContainer = new GameplayEffectsContainer(this);
            AbilitiesContainer = new GameplayAbilitiesContainer(this);
        }

        protected virtual void Update()
        {
            var dt = Time.deltaTime;
            AbilitiesContainer.OnUpdate(dt);
            EffectsContainer.OnUpdate(dt);
            CueContainer.OnUpdate(dt);
        }
    }
}